package gui;

import gui.panel.ConnectionPanel;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;


public class MainWindow extends JFrame {

	private static MainWindow INSTANCE;
	
	private MainWindow() {
		super("P2P Chat System");
		this.getContentPane().add(new ConnectionPanel());
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setSize(640, 480);
		this.setVisible(true);
	}
	
	public static MainWindow getInstance() {
		if (MainWindow.INSTANCE == null) {
			MainWindow.INSTANCE = new MainWindow();
		}
		
		return MainWindow.INSTANCE;
	}
	
	
	/**
	 * @param argsn6
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		MainWindow.getInstance();
	}

}
